
package DTO;

/**
 * This class acts as data transfer abstraction for address object attributes. It encapsulates address attributes.
 * This object is transferred back and forth amongst various layers.
 * @author tejinder
 * @see DTO
 */
public class Address {

    private int id;
    private String aptNo;
    private int stNo;
    private String street;
    private String city;
    private String province;
    private String postCode;

/**
 * parameterized constructor
 * @param id
 * @param aptNo
 * @param stNo
 * @param street
 * @param postCode
 * @param city
 * @param province
 */
    public Address(int id, String aptNo, int stNo, String street,
            String postCode, String city, String province) {
        this.id = id;
        this.aptNo = aptNo;
        this.stNo = stNo;
        this.street = street;
        this.postCode = postCode;
        this.city = city;
        this.province = province;
    }

    /**
     * default empty constructor
     */
    public Address() {
    }

    /**
     * gets address id
     * @return an integer address id
     */
    public int getID() {
        return id;
    }

    /**
     * sets address id
     * @param id
     */
    public void setID(int id) {
        this.id = id;
    }

    /**
     * returns apartment number
     * @return
     */
    public String getAptNo() {
        return aptNo;
    }

    /**
     * sets apartment number
     * @param aptNo
     */
    public void setAptNo(String aptNo) {
        this.aptNo = aptNo;
    }

    /**
     * gets street number
     * @return string
     */
    public int getStNo() {
        return stNo;
    }

    /**
     * sets the street number
     * @param stNo
     */
    public void setStNo(int stNo) {
        this.stNo = stNo;
    }

    /**
     * gets street
     * @return string
     */
    public String getStreet() {
        return street;
    }

    /**
     * sets the street
     * @param street
     */
    public void setStreet(String street) {
        this.street = street;
    }

    /**
     * gets the postal code
     * @return string
     */
    public String getPostCode() {
        return postCode;
    }

    /**
     * sets the post code
     * @param postCode
     */
    public void setPostCode(String postCode) {
        this.postCode = postCode;
    }

    /**
     * gets the city
     * @return a string of city
     */
    public String getCity() {
        return city;
    }

    /**
     * sets the city
     * @param city
     */
    public void setCity(String city) {
        this.city = city;
    }

    /**
     * gets the province
     * @return string
     */
    public String getProvince() {
        return province;
    }

    /**
     * sets the province
     * @param province
     */
    public void setProvince(String province) {
        this.province = province;
        //;
    }

    /**
     * toString() method overrides the default behavior of Object class toString() method.
     * @return  a string representing the state of object
     */
    @Override
    public String toString() {
        String result = "";

        if (aptNo != null) {
            result += aptNo + " ";
        }

        return result += stNo + " " + street + ", " + postCode + " " + city +
                " " + province;
    }
}
